//
// api.js
// vue3-element-admin
//
// Created by 区区电脑 on 2023/04/12.
//



import request from  "@/request"


/**
 * 获取用户分页列表
 * @param params
 * @param data
 * @returns {*}
 * @constructor
 */
export function GetUserPageList(params = {}, data = {}) {
    return request({url: '/api/SysUser/GetUserPageList', method: 'POST', params, data})
}

/**
 * 获取用户列表
 * @param data
 * @returns {*}
 * @constructor
 */
export function GetUserList(data = {}) {
    return request({url: '/api/SysUser/GetUserList', method: 'POST',  data})
}


/**
 * 根据角色用户列表
 * @param params
 * @param data
 * @returns {*}
 * @constructor
 */
export function GetUserListByRoleId(params = {}, data = {}) {
    return request({url: '/api/SysUser/GetUserListByRoleId', method: 'GET', params})
}

/**
 * 新增用户
 * @param data
 * @returns {*}
 * @constructor
 */
export function AddUserInfo(data = {}) {
    return request({url: '/api/SysUser/AddUserInfo', method: 'POST', data})
}

/**
 * 修改用户信息
 * @param data
 * @returns {*}
 * @constructor
 */
export function UpdateUserInfo(data = {}) {
    return request({url: '/api/SysUser/UpdateUserInfo', method: 'PUT', data})
}

/**
 * 删除用户
 * @param params
 * @returns {*}
 * @constructor
 */
export function DeleteUserInfo(params = {}) {
    return request({url: '/api/SysUser/DeleteUserInfo', method: 'DELETE', params})
}

/**
 * 假删除用户
 * @param params
 * @returns {*}
 * @constructor
 */
export function DeleteUserInfoByFake(params = {}) {
    return request({url: '/api/SysUser/DeleteUserInfoByFake', method: 'DELETE', params})
}
/**
 * 批量删除用户
 * @param params
 * @returns {*}
 * @constructor
 */
export function DeleteUserList(data = []) {
    return request({url: '/api/SysUser/DeleteUserList', method: 'DELETE', data})
}

/**
 * 重置密码
 * @param data
 * @returns {*}
 * @constructor
 */
export function ResetUserPassword(data = {}) {
    return request({url: '/api/SysUser/ResetUserPassword', method: 'POST', data})
}

/**
 * 获取用户详情
 * @param params
 * @returns {*}
 * @constructor
 */
export function GetUserInfoById(params = {}) {
    return request({url: '/api/SysUser/GetUserInfoById', method: 'GET', params})
}


/**
 * 修改用户密码
 * @param data
 * @returns {*}
 * @constructor
 */
export function UpdateUserPassword(data = {}) {
    return request({url: '/api/SysUser/UpdateUserPassword', method: 'PUT', data})
}


/**
 * 查询组织树
 * @param params
 * @returns {*}
 * @constructor
 */
export function GetOrgTreeList(params = {}) {
    return request({url: `/api/SysOrg/GetOrgTree`, method: 'get', params})
}

/**
 * 查询职位列表
 * @param data
 * @returns {*}
 * @constructor
 */
export function GetPostList(data = {}) {
    return request({url: '/api/SysPost/GetPostList', method: 'POST', data})
}

/**
 * 查询角色列表
 * @param data
 * @returns {*}
 * @constructor
 */
export function GetRoleList(data = {}) {
    return request({url: '/api/SysRole/GetRoleList', method: 'POST', data})
}

// 导入用户
export function ImportUserList(params = {}, data = {}) {
    return request({url: "/api/SysUser/ImportUserList", method: "post", params, data, upload: true})
}
